<template>
  <view class="loading-state">
    <view class="loading-content">
      <view class="loading-spinner"></view>
      <text class="loading-text">{{ text }}</text>
    </view>
  </view>
</template>

<script>
export default {
  name: 'loading-state',
  props: {
    text: {
      type: String,
      default: '加载中...'
    }
  }
}
</script>

<style lang="scss">
.loading-state {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 246, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  
  .loading-content {
    display: flex;
    align-items: center;
    padding: 20rpx 40rpx;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12rpx;
    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
    
    .loading-spinner {
      width: 40rpx;
      height: 40rpx;
      border: 6rpx solid #f3f3f3;
      border-top: 6rpx solid #2b7ff3;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-right: 20rpx;
    }
    
    .loading-text {
      font-size: 28rpx;
      color: #333;
    }
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
</style>